using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
//using VI.Bfw.Logging;

namespace VI.Fsc.OperatorGui.Models.Application
{
    public class CFscException : Exception
    {
        private MethodBase method;
        private string logMessage;
        private string errorMessageTitle;
        private string errorMessageBody;

        private const string TITLE_POSTFIX = "Title";
        private const string BODY_POSTFIX = "Message";
        private const string CONTEXT = "FSCErrors";

        public string Context
        {
            get
            {
                return CONTEXT;
            }
        }

        public MethodBase Method
        {
            get
            {
                return this.method;
            }
            set
            {
                this.method = value;
            }
        }

        public string LogMessage
        {
            get
            {
                return this.logMessage;
            }
            set
            {
                this.logMessage = value;
            }
        }

        public string MessageTitle
        {
            get
            {
                return this.errorMessageTitle;
            }
            set
            {
                this.errorMessageTitle = value + TITLE_POSTFIX;
            }
        }

        public string MessageBody
        {
            get
            {
                return this.errorMessageBody;
            }
            set
            {
                this.errorMessageBody = value + BODY_POSTFIX;
            }
        }

        public CFscException(MethodBase method, string logMessage, string errorKeyString)
        {
            //Logger.Error(method, logMessage);

            Method = method;
            LogMessage = logMessage;
            MessageTitle = errorKeyString;
            MessageBody = errorKeyString;
        }
    }
}
